

void UI_DlgLine::setLine(PF_Line& l) {
    line = &l;
    //pen = line->getPen();
    wPen->setPen(line->getPen(false), true, false, "Pen");
    PF_Graphic* graphic = line->getGraphic();
    if (graphic!=NULL) {
        cbLayer->init(*(graphic->getLayerList()), false, false);
    }
    PF_Layer* lay = line->getLayer(false);
    if (lay!=NULL) {
        cbLayer->setLayer(*lay);
    }
    QString s;
    s.setNum(line->getStartpoint().x);
    leStartX->setText(s);
    s.setNum(line->getStartpoint().y);
    leStartY->setText(s);
    s.setNum(line->getEndpoint().x);
    leEndX->setText(s);
    s.setNum(line->getEndpoint().y);
    leEndY->setText(s);
}

void UI_DlgLine::updateLine() {
    line->setStartpoint(PF_Vector(PF_Math::eval(leStartX->text()),
                                  PF_Math::eval(leStartY->text())));
    line->setEndpoint(PF_Vector(PF_Math::eval(leEndX->text()),
                                PF_Math::eval(leEndY->text())));
    line->setPen(wPen->getPen());
    line->setLayer(cbLayer->currentText());
}

